package com.uyayo.cms.service;

import com.uyayo.cms.dto.CmsArticleDTO;
import com.uyayo.cms.entity.CmsArticle;
import com.uyayo.cms.entity.CmsArticleLike;
import com.uyayo.cms.model.CmsArticleCondition;
import com.uyayo.cms.model.CmsArticleCountBO;
import com.uyayo.framework.pagehelper.pojo.PageBean;

import java.util.List;

public interface CmsArticleService {


	CmsArticle getArticleById(Long id) throws Exception;

	List<CmsArticle> selectArticle(CmsArticleCondition cmsArticleCondition);

	PageBean<CmsArticle> selectArticleByPaging(Integer page, Integer rows, String sort, String order, CmsArticleCondition cmsArticleCondition);

	/**
	 * 获取下一篇文章
	 * @param id 文章id
	 * @return CmsArticle
	 */
	CmsArticle getAfterArticle(Long id,Long channelId);

	/**
	 * 获取上一篇文章
	 * @param id 文章id
	 * @return CmsArticle
	 */
	CmsArticle getPrevArticle(Long id,Long channelId);

	int createCmsArticle(CmsArticleDTO cmsArticleDTO);

	CmsArticle selectOne(CmsArticle cmsArticle);

	int updateArticle(CmsArticleDTO cmsArticleDTO);

	int deleteArticle(Long id);

    int updateArticleCount(CmsArticleCountBO cmsArticleCountBO);

    int like(CmsArticleLike cmsArticleLike);


}
